#include <limits.h>
#include "matrix.h"
#include "gtest/gtest.h"

TEST(AddTest, Blah ){
	matrix a;
	a.populate_matrix(1,1,1,1);
	matrix b;
	b.populate_matrix(1,1,1,1);
	matrix res;
	res.add(a,b);


  EXPECT_EQ(res.values[0][0],2 );
  EXPECT_EQ(res.values[0][1],2 );
  EXPECT_EQ(res.values[1][0],2 );
  EXPECT_EQ(res.values[1][1],2 );
}

TEST(SubTest, Blah ){
	matrix a;
	a.populate_matrix(2,2,2,2);
	matrix b;
	b.populate_matrix(1,1,1,1);
	matrix res;
	res.subtract(a,b);


  EXPECT_EQ(res.values[0][0],1 );
  EXPECT_EQ(res.values[0][1],1 );
  EXPECT_EQ(res.values[1][0],1 );
  EXPECT_EQ(res.values[1][1],1 );
}

TEST(MultiplyTest, Blah ){
	matrix a;
	a.populate_matrix(2,2,2,2);
	matrix b;
	b.populate_matrix(2,2,2,2);
	matrix res;
	res.multiply(a,b);


  EXPECT_EQ(res.values[0][0],4 );
  EXPECT_EQ(res.values[0][1],4 );
  EXPECT_EQ(res.values[1][0],4 );
  EXPECT_EQ(res.values[1][1],4 );
}

TEST(MultAddTest, Blah){
	matrix a;
	a.populate_matrix(2,2,2,2);
	matrix b;
	b.populate_matrix(2,2,2,2);
	matrix c;
	c.populate_matrix(1,1,1,1);
	matrix res;
	res.multiply(a,b);
	matrix final;
	final.add(res,c);

	EXPECT_EQ(final.values[0][0],5 );
  EXPECT_EQ(final.values[0][1],5 );
  EXPECT_EQ(final.values[1][0],5 );
  EXPECT_EQ(final.values[1][1],5 );

}

